package nl.han.ica.ap.searchengine.client;

/**
 * Represents a single result-page, usually contained within a 'SearchResults'-object.
 * 
 * @author A.J. Janssen, ...
 * @version 0.1
 *
 */
public class ResultPage implements Comparable<ResultPage> 
{
	public final String url; //title, content, (short) description?
	public final long score;

	public int compareTo(ResultPage arg0) 
	{
		return (int) (score - arg0.score);
	}
	
	//This class has the potential to grow a large number of (very) similar constructors. 
	//To keep the API consistent this class will use factory static methods for object creation 
	//(ie: only private constructors and public static create-methods)
	
	public static ResultPage createSimplePage(String url, long score)
	{
		return new ResultPage(url, score);
	}
	
	private ResultPage(String url, long score)
	{
		this.score = score;
		this.url = url;
	}
	
	public ResultPage(String url)
	{
		this.url = url;
		this.score = (Long) null;
	}
}
